package cn.iocoder.yudao.module.expert.dal.mysql.expertinfo;

import java.util.*;

import cn.iocoder.yudao.framework.common.pojo.PageResult;
import cn.iocoder.yudao.framework.mybatis.core.query.LambdaQueryWrapperX;
import cn.iocoder.yudao.framework.mybatis.core.mapper.BaseMapperX;
import cn.iocoder.yudao.module.expert.controller.admin.extractinfo.vo.ExtractInfoSaveReqVO;
import cn.iocoder.yudao.module.expert.dal.dataobject.expertinfo.ExpertInfoDO;
import org.apache.ibatis.annotations.Mapper;
import cn.iocoder.yudao.module.expert.controller.admin.expertinfo.vo.*;
import org.apache.ibatis.annotations.Select;

/**
 * 专家信息 Mapper
 *
 * @author 周天贺
 */
@Mapper
public interface ExpertInfoMapper extends BaseMapperX<ExpertInfoDO> {

    default PageResult<ExpertInfoDO> selectPage(ExpertInfoPageReqVO reqVO) {
        return selectPage(reqVO, new LambdaQueryWrapperX<ExpertInfoDO>()
                .likeIfPresent(ExpertInfoDO::getExpertName, reqVO.getExpertName())
                .eqIfPresent(ExpertInfoDO::getExpertUnit, reqVO.getExpertUnit())
                .eqIfPresent(ExpertInfoDO::getExpertPhone, reqVO.getExpertPhone())
                .eqIfPresent(ExpertInfoDO::getExpertMajor, reqVO.getExpertMajor())
                .eqIfPresent(ExpertInfoDO::getExpertTitle, reqVO.getExpertTitle())
                .eqIfPresent(ExpertInfoDO::getExpertIden, reqVO.getExpertIden())
                .eqIfPresent(ExpertInfoDO::getRemark, reqVO.getRemark())
                .betweenIfPresent(ExpertInfoDO::getCreateTime, reqVO.getCreateTime())
                .orderByDesc(ExpertInfoDO::getId));
    }

     List<ExpertInfoDO> selectRandom(ExtractInfoSaveReqVO createReqVO) ;

    default List<ExpertInfoDO> selectList(String expertMajor ) {
        return selectList(new LambdaQueryWrapperX<ExpertInfoDO>().eqIfPresent(ExpertInfoDO::getExpertMajor, expertMajor));
    } ;
}